/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
 *       Filename:  frame.h
 *    Description:  Формата фрейма CarRing2 L2 и функций 
 *                  генерации случайного фрейма
 *
 *        Version:  1.0
 *        Created:  12.02.2013 00:03:52
 *         Author:  Aleksey Golovchenko (lexgolovchenko@gmail.com)
 *   Organization:  St.Petersburg State Polytecnical Universisy
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#ifndef frame_h_
#define frame_h_

/*
 * CarRing L2 frame
 */
#define FRAME_DATA_SIZE 60

typedef struct frame_t_ {
    unsigned char data[FRAME_DATA_SIZE];         // Contains headers and data fields
    unsigned long crc;
} frame_t;

#define FRAME_SIZE (sizeof(frame_t))

extern void generate_random_frame(frame_t *frame);
extern int check_frame_crc(frame_t *frame);

#endif
